<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>OL-Cesium API Documentation - Source: src/autorenderloop.js</title>
    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <script src="scripts/jquery.min.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
    <link type="text/css" rel="stylesheet" href="styles/jaguar.css">
</head>
<body>
<div id="wrap" class="clearfix">
    
<div class="navigation">
    <h3 class="applicationName"><a href="index.html">OL-Cesium</a></h3>
    <div class="search">
        <input id="search" type="text" class="form-control input-sm" placeholder="Search Documentation">
    </div>
    <ul class="list">
    
        <li class="item" data-name="olcs.AbstractSynchronizer">
            <span class="title">
                <a href="olcs.AbstractSynchronizer.html">olcs.AbstractSynchronizer</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="olcs.AbstractSynchronizer#synchronize" class="unstable">
                    <a href="olcs.AbstractSynchronizer.html#synchronize">synchronize</a>
                </li>
            
            </ul>
            <ul class="fires itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="olcs.AutoRenderLoop">
            <span class="title">
                <a href="olcs.AutoRenderLoop.html">olcs.AutoRenderLoop</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="olcs.AutoRenderLoop#restartRenderLoop" class="unstable">
                    <a href="olcs.AutoRenderLoop.html#restartRenderLoop">restartRenderLoop</a>
                </li>
            
                <li data-name="olcs.AutoRenderLoop#setDebug" class="unstable">
                    <a href="olcs.AutoRenderLoop.html#setDebug">setDebug</a>
                </li>
            
            </ul>
            <ul class="fires itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="olcs.Camera">
            <span class="title">
                <a href="olcs.Camera.html">olcs.Camera</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="olcs.Camera#getAltitude" class="unstable">
                    <a href="olcs.Camera.html#getAltitude">getAltitude</a>
                </li>
            
                <li data-name="olcs.Camera#getCenter" class="unstable">
                    <a href="olcs.Camera.html#getCenter">getCenter</a>
                </li>
            
                <li data-name="olcs.Camera#getDistance" class="unstable">
                    <a href="olcs.Camera.html#getDistance">getDistance</a>
                </li>
            
                <li data-name="olcs.Camera#getHeading" class="unstable">
                    <a href="olcs.Camera.html#getHeading">getHeading</a>
                </li>
            
                <li data-name="olcs.Camera#getPosition" class="unstable">
                    <a href="olcs.Camera.html#getPosition">getPosition</a>
                </li>
            
                <li data-name="olcs.Camera#getTilt" class="unstable">
                    <a href="olcs.Camera.html#getTilt">getTilt</a>
                </li>
            
                <li data-name="olcs.Camera#lookAt" class="unstable">
                    <a href="olcs.Camera.html#lookAt">lookAt</a>
                </li>
            
                <li data-name="olcs.Camera#readFromView" class="unstable">
                    <a href="olcs.Camera.html#readFromView">readFromView</a>
                </li>
            
                <li data-name="olcs.Camera#setAltitude" class="unstable">
                    <a href="olcs.Camera.html#setAltitude">setAltitude</a>
                </li>
            
                <li data-name="olcs.Camera#setCenter" class="unstable">
                    <a href="olcs.Camera.html#setCenter">setCenter</a>
                </li>
            
                <li data-name="olcs.Camera#setDistance" class="unstable">
                    <a href="olcs.Camera.html#setDistance">setDistance</a>
                </li>
            
                <li data-name="olcs.Camera#setHeading" class="unstable">
                    <a href="olcs.Camera.html#setHeading">setHeading</a>
                </li>
            
                <li data-name="olcs.Camera#setPosition" class="unstable">
                    <a href="olcs.Camera.html#setPosition">setPosition</a>
                </li>
            
                <li data-name="olcs.Camera#setTilt" class="unstable">
                    <a href="olcs.Camera.html#setTilt">setTilt</a>
                </li>
            
                <li data-name="olcs.Camera#updateView" class="unstable">
                    <a href="olcs.Camera.html#updateView">updateView</a>
                </li>
            
            </ul>
            <ul class="fires itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="olcs.FeatureConverter">
            <span class="title">
                <a href="olcs.FeatureConverter.html">olcs.FeatureConverter</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="olcs.FeatureConverter#computePlainStyle" class="unstable">
                    <a href="olcs.FeatureConverter.html#computePlainStyle">computePlainStyle</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#convert" class="unstable">
                    <a href="olcs.FeatureConverter.html#convert">convert</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#csAddBillboard" class="unstable">
                    <a href="olcs.FeatureConverter.html#csAddBillboard">csAddBillboard</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#getHeightReference" class="unstable">
                    <a href="olcs.FeatureConverter.html#getHeightReference">getHeightReference</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#olCircleGeometryToCesium" class="unstable">
                    <a href="olcs.FeatureConverter.html#olCircleGeometryToCesium">olCircleGeometryToCesium</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#olFeatureToCesium" class="unstable">
                    <a href="olcs.FeatureConverter.html#olFeatureToCesium">olFeatureToCesium</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#olGeometry4326TextPartToCesium" class="unstable">
                    <a href="olcs.FeatureConverter.html#olGeometry4326TextPartToCesium">olGeometry4326TextPartToCesium</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#olLineStringGeometryToCesium" class="unstable">
                    <a href="olcs.FeatureConverter.html#olLineStringGeometryToCesium">olLineStringGeometryToCesium</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#olMultiGeometryToCesium" class="unstable">
                    <a href="olcs.FeatureConverter.html#olMultiGeometryToCesium">olMultiGeometryToCesium</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#olPointGeometryToCesium" class="unstable">
                    <a href="olcs.FeatureConverter.html#olPointGeometryToCesium">olPointGeometryToCesium</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#olPolygonGeometryToCesium" class="unstable">
                    <a href="olcs.FeatureConverter.html#olPolygonGeometryToCesium">olPolygonGeometryToCesium</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#olStyleToCesium" class="unstable">
                    <a href="olcs.FeatureConverter.html#olStyleToCesium">olStyleToCesium</a>
                </li>
            
                <li data-name="olcs.FeatureConverter#olVectorLayerToCesium" class="unstable">
                    <a href="olcs.FeatureConverter.html#olVectorLayerToCesium">olVectorLayerToCesium</a>
                </li>
            
            </ul>
            <ul class="fires itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="olcs.OLCesium">
            <span class="title">
                <a href="olcs.OLCesium.html">olcs.OLCesium</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="olcs.OLCesium#enableAutoRenderLoop" class="unstable">
                    <a href="olcs.OLCesium.html#enableAutoRenderLoop">enableAutoRenderLoop</a>
                </li>
            
                <li data-name="olcs.OLCesium#getAutoRenderLoop" class="unstable">
                    <a href="olcs.OLCesium.html#getAutoRenderLoop">getAutoRenderLoop</a>
                </li>
            
                <li data-name="olcs.OLCesium#getCamera" class="unstable">
                    <a href="olcs.OLCesium.html#getCamera">getCamera</a>
                </li>
            
                <li data-name="olcs.OLCesium#getCesiumScene" class="unstable">
                    <a href="olcs.OLCesium.html#getCesiumScene">getCesiumScene</a>
                </li>
            
                <li data-name="olcs.OLCesium#getDataSourceDisplay" class="unstable">
                    <a href="olcs.OLCesium.html#getDataSourceDisplay">getDataSourceDisplay</a>
                </li>
            
                <li data-name="olcs.OLCesium#getDataSources" class="unstable">
                    <a href="olcs.OLCesium.html#getDataSources">getDataSources</a>
                </li>
            
                <li data-name="olcs.OLCesium#getEnabled" class="unstable">
                    <a href="olcs.OLCesium.html#getEnabled">getEnabled</a>
                </li>
            
                <li data-name="olcs.OLCesium#getOlMap" class="unstable">
                    <a href="olcs.OLCesium.html#getOlMap">getOlMap</a>
                </li>
            
                <li data-name="olcs.OLCesium#setBlockCesiumRendering" class="unstable">
                    <a href="olcs.OLCesium.html#setBlockCesiumRendering">setBlockCesiumRendering</a>
                </li>
            
                <li data-name="olcs.OLCesium#setEnabled" class="unstable">
                    <a href="olcs.OLCesium.html#setEnabled">setEnabled</a>
                </li>
            
                <li data-name="olcs.OLCesium#setResolutionScale" class="unstable">
                    <a href="olcs.OLCesium.html#setResolutionScale">setResolutionScale</a>
                </li>
            
                <li data-name="olcs.OLCesium#setTargetFrameRate" class="unstable">
                    <a href="olcs.OLCesium.html#setTargetFrameRate">setTargetFrameRate</a>
                </li>
            
                <li data-name="olcs.OLCesium#warmUp" class="unstable">
                    <a href="olcs.OLCesium.html#warmUp">warmUp</a>
                </li>
            
            </ul>
            <ul class="fires itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="olcs.RasterSynchronizer">
            <span class="title">
                <a href="olcs.RasterSynchronizer.html">olcs.RasterSynchronizer</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            </ul>
            <ul class="fires itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="olcs.VectorSynchronizer">
            <span class="title">
                <a href="olcs.VectorSynchronizer.html">olcs.VectorSynchronizer</a>
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            </ul>
            <ul class="fires itemMembers">
            
            </ul>
        </li>
    
        <li class="item" data-name="olcs.core">
            <span class="title">
                <a href="olcs.core.html">olcs.core</a>
                
                
            </span>
            <ul class="members itemMembers">
            
            </ul>
            <ul class="typedefs itemMembers">
            
            </ul>
            <ul class="methods itemMembers">
            
            <span class="subtitle">Methods</span>
            
                <li data-name="olcs.core.applyHeightOffsetToGeometry" class="unstable">
                    <a href="olcs.core.html#.applyHeightOffsetToGeometry">applyHeightOffsetToGeometry</a>
                </li>
            
                <li data-name="olcs.core.computeAngleToZenith" class="unstable">
                    <a href="olcs.core.html#.computeAngleToZenith">computeAngleToZenith</a>
                </li>
            
                <li data-name="olcs.core.computePixelSizeAtCoordinate" class="unstable">
                    <a href="olcs.core.html#.computePixelSizeAtCoordinate">computePixelSizeAtCoordinate</a>
                </li>
            
                <li data-name="olcs.core.computeSignedTiltAngleOnGlobe" class="unstable">
                    <a href="olcs.core.html#.computeSignedTiltAngleOnGlobe">computeSignedTiltAngleOnGlobe</a>
                </li>
            
                <li data-name="olcs.core.convertColorToCesium" class="unstable">
                    <a href="olcs.core.html#.convertColorToCesium">convertColorToCesium</a>
                </li>
            
                <li data-name="olcs.core.convertUrlToCesium" class="unstable">
                    <a href="olcs.core.html#.convertUrlToCesium">convertUrlToCesium</a>
                </li>
            
                <li data-name="olcs.core.extentToRectangle" class="unstable">
                    <a href="olcs.core.html#.extentToRectangle">extentToRectangle</a>
                </li>
            
                <li data-name="olcs.core.lookAt" class="unstable">
                    <a href="olcs.core.html#.lookAt">lookAt</a>
                </li>
            
                <li data-name="olcs.core.ol4326CoordinateArrayToCsCartesians" class="unstable">
                    <a href="olcs.core.html#.ol4326CoordinateArrayToCsCartesians">ol4326CoordinateArrayToCsCartesians</a>
                </li>
            
                <li data-name="olcs.core.ol4326CoordinateToCesiumCartesian" class="unstable">
                    <a href="olcs.core.html#.ol4326CoordinateToCesiumCartesian">ol4326CoordinateToCesiumCartesian</a>
                </li>
            
                <li data-name="olcs.core.olGeometryCloneTo4326" class="unstable">
                    <a href="olcs.core.html#.olGeometryCloneTo4326">olGeometryCloneTo4326</a>
                </li>
            
                <li data-name="olcs.core.pickBottomPoint" class="unstable">
                    <a href="olcs.core.html#.pickBottomPoint">pickBottomPoint</a>
                </li>
            
                <li data-name="olcs.core.pickCenterPoint" class="unstable">
                    <a href="olcs.core.html#.pickCenterPoint">pickCenterPoint</a>
                </li>
            
                <li data-name="olcs.core.pickOnTerrainOrEllipsoid" class="unstable">
                    <a href="olcs.core.html#.pickOnTerrainOrEllipsoid">pickOnTerrainOrEllipsoid</a>
                </li>
            
                <li data-name="olcs.core.rotateAroundAxis" class="unstable">
                    <a href="olcs.core.html#.rotateAroundAxis">rotateAroundAxis</a>
                </li>
            
                <li data-name="olcs.core.setHeadingUsingBottomCenter" class="unstable">
                    <a href="olcs.core.html#.setHeadingUsingBottomCenter">setHeadingUsingBottomCenter</a>
                </li>
            
                <li data-name="olcs.core.tileLayerToImageryLayer" class="unstable">
                    <a href="olcs.core.html#.tileLayerToImageryLayer">tileLayerToImageryLayer</a>
                </li>
            
                <li data-name="olcs.core.updateCesiumLayerProperties" class="unstable">
                    <a href="olcs.core.html#.updateCesiumLayerProperties">updateCesiumLayerProperties</a>
                </li>
            
            </ul>
            <ul class="fires itemMembers">
            
            </ul>
        </li>
    
    </ul>
</div>
    <div class="main">
        <h1 class="page-title" data-filename="src_autorenderloop.js.html">Source: src/autorenderloop.js</h1>
        


    
    <section>
        <article>
            <pre class="prettyprint source"><code>// Apache v2 license
// https://github.com/TerriaJS/terriajs/blob/
// ebd382a8278a817fce316730d9e459bbb9b829e9/lib/Models/Cesium.js

goog.provide('olcs.AutoRenderLoop');



/**
 * @constructor
 * @param {olcs.OLCesium} ol3d
 * @param {boolean} debug
 * @struct
 */
olcs.AutoRenderLoop = function(ol3d, debug) {
  this.ol3d = ol3d;
  this.scene_ = ol3d.getCesiumScene();
  this.verboseRendering = debug;
  this._boundNotifyRepaintRequired = this.notifyRepaintRequired.bind(this);

  this.lastCameraViewMatrix_ = new Cesium.Matrix4();
  this.lastCameraMoveTime_ = 0;
  this.stoppedRendering = false;

  this._removePostRenderListener = this.scene_.postRender.addEventListener(
      this.postRender.bind(this));


  // Detect available wheel event
  this._wheelEvent = '';
  if ('onwheel' in this.scene_.canvas) {
    // spec event type
    this._wheelEvent = 'wheel';
  } else if (!!document['onmousewheel']) {
    // legacy event type
    this._wheelEvent = 'mousewheel';
  } else {
    // older Firefox
    this._wheelEvent = 'DOMMouseScroll';
  }

  this._originalLoadWithXhr = Cesium.loadWithXhr.load;
  this._originalScheduleTask = Cesium.TaskProcessor.prototype.scheduleTask;
  this._originalCameraSetView = Cesium.Camera.prototype.setView;
  this._originalCameraMove = Cesium.Camera.prototype.move;
  this._originalCameraRotate = Cesium.Camera.prototype.rotate;
  this._originalCameraLookAt = Cesium.Camera.prototype.lookAt;
  this._originalCameraFlyTo = Cesium.Camera.prototype.flyTo;

  this.enable();
};


/**
 * Force a repaint when the mouse moves or the window changes size.
 * @param {string} key
 * @param {boolean} capture
 * @private
 */
olcs.AutoRenderLoop.prototype.repaintOn_ = function(key, capture) {
  const canvas = this.scene_.canvas;
  canvas.addEventListener(key, this._boundNotifyRepaintRequired, capture);
};


/**
 * @param {string} key
 * @param {boolean} capture
 * @private
 */
olcs.AutoRenderLoop.prototype.removeRepaintOn_ = function(key, capture) {
  const canvas = this.scene_.canvas;
  canvas.removeEventListener(key, this._boundNotifyRepaintRequired, capture);
};


/**
 * Enable.
 */
olcs.AutoRenderLoop.prototype.enable = function() {
  this.repaintOn_('mousemove', false);
  this.repaintOn_('mousedown', false);
  this.repaintOn_('mouseup', false);
  this.repaintOn_('touchstart', false);
  this.repaintOn_('touchend', false);
  this.repaintOn_('touchmove', false);

  if (!!window['PointerEvent']) {
    this.repaintOn_('pointerdown', false);
    this.repaintOn_('pointerup', false);
    this.repaintOn_('pointermove', false);
  }

  this.repaintOn_(this._wheelEvent, false);

  window.addEventListener('resize', this._boundNotifyRepaintRequired, false);

  // Hacky way to force a repaint when an async load request completes
  const that = this;
  Cesium.loadWithXhr.load = function(url, responseType, method, data,
      headers, deferred, overrideMimeType, preferText, timeout) {
    deferred['promise']['always'](that._boundNotifyRepaintRequired);
    that._originalLoadWithXhr(url, responseType, method, data, headers,
        deferred, overrideMimeType, preferText, timeout);
  };

  // Hacky way to force a repaint when a web worker sends something back.
  Cesium.TaskProcessor.prototype.scheduleTask = function(parameters, transferableObjects) {
    const result = that._originalScheduleTask.call(this, parameters,
        transferableObjects);

    const taskProcessor = this;
    if (!taskProcessor._originalWorkerMessageSinkRepaint) {
      const worker = taskProcessor['_worker'];
      taskProcessor._originalWorkerMessageSinkRepaint = worker.onmessage;
      worker.onmessage = function(event) {
        taskProcessor._originalWorkerMessageSinkRepaint(event);
        that.notifyRepaintRequired();
      };
    }

    return result;
  };

  Cesium.Camera.prototype.setView = function(...args) {
    that._originalCameraSetView.apply(this, args);
    that.notifyRepaintRequired();
  };
  Cesium.Camera.prototype.move = function(...args) {
    that._originalCameraMove.apply(this, args);
    that.notifyRepaintRequired();
  };
  Cesium.Camera.prototype.rotate = function(...args) {
    that._originalCameraRotate.apply(this, args);
    that.notifyRepaintRequired();
  };
  Cesium.Camera.prototype.lookAt = function(...args) {
    that._originalCameraLookAt.apply(this, args);
    that.notifyRepaintRequired();
  };
  Cesium.Camera.prototype.flyTo = function(...args) {
    that._originalCameraFlyTo.apply(this, args);
    that.notifyRepaintRequired();
  };

  // Listen for changes on the layer group
  this.ol3d.getOlMap().getLayerGroup().on('change',
      this._boundNotifyRepaintRequired);
};


/**
 * Disable.
 */
olcs.AutoRenderLoop.prototype.disable = function() {
  if (!!this._removePostRenderListener) {
    this._removePostRenderListener();
    this._removePostRenderListener = undefined;
  }

  this.removeRepaintOn_('mousemove', false);
  this.removeRepaintOn_('mousedown', false);
  this.removeRepaintOn_('mouseup', false);
  this.removeRepaintOn_('touchstart', false);
  this.removeRepaintOn_('touchend', false);
  this.removeRepaintOn_('touchmove', false);

  if (!!window['PointerEvent']) {
    this.removeRepaintOn_('pointerdown', false);
    this.removeRepaintOn_('pointerup', false);
    this.removeRepaintOn_('pointermove', false);
  }

  this.removeRepaintOn_(this._wheelEvent, false);

  window.removeEventListener('resize', this._boundNotifyRepaintRequired, false);

  Cesium.loadWithXhr.load = this._originalLoadWithXhr;
  Cesium.TaskProcessor.prototype.scheduleTask = this._originalScheduleTask;
  Cesium.Camera.prototype.setView = this._originalCameraSetView;
  Cesium.Camera.prototype.move = this._originalCameraMove;
  Cesium.Camera.prototype.rotate = this._originalCameraRotate;
  Cesium.Camera.prototype.lookAt = this._originalCameraLookAt;
  Cesium.Camera.prototype.flyTo = this._originalCameraFlyTo;

  this.ol3d.getOlMap().getLayerGroup().un('change',
      this._boundNotifyRepaintRequired);
};


/**
 * @param {number} date
 */
olcs.AutoRenderLoop.prototype.postRender = function(date) {
  // We can safely stop rendering when:
  //  - the camera position hasn't changed in over a second,
  //  - there are no tiles waiting to load, and
  //  - the clock is not animating
  //  - there are no tweens in progress

  const now = Date.now();

  const scene = this.scene_;
  const camera = scene.camera;

  if (!Cesium.Matrix4.equalsEpsilon(this.lastCameraViewMatrix_,
      camera.viewMatrix, 1e-5)) {
    this.lastCameraMoveTime_ = now;
  }

  const cameraMovedInLastSecond = now - this.lastCameraMoveTime_ &lt; 1000;

  const surface = scene.globe['_surface'];
  const tilesWaiting = !surface['tileProvider'].ready ||
      surface['_tileLoadQueueHigh'].length > 0 ||
      surface['_tileLoadQueueMedium'].length > 0 ||
      surface['_tileLoadQueueLow'].length > 0 ||
      surface['_debug']['tilesWaitingForChildren'] > 0;

  const tweens = scene['tweens'];
  if (!cameraMovedInLastSecond &amp;&amp; !tilesWaiting &amp;&amp; tweens.length == 0) {
    if (this.verboseRendering) {
      console.log(`stopping rendering @ ${Date.now()}`);
    }
    this.ol3d.setBlockCesiumRendering(true);
    this.stoppedRendering = true;
  }

  Cesium.Matrix4.clone(camera.viewMatrix, this.lastCameraViewMatrix_);
};


/**
 * Restart render loop.
 * Force a restart of the render loop.
 * @api
 */
olcs.AutoRenderLoop.prototype.restartRenderLoop = function() {
  this.notifyRepaintRequired();
};


/**
 * Notifies the viewer that a repaint is required.
 */
olcs.AutoRenderLoop.prototype.notifyRepaintRequired = function() {
  if (this.verboseRendering &amp;&amp; this.stoppedRendering) {
    console.log(`starting rendering @ ${Date.now()}`);
  }
  this.lastCameraMoveTime_ = Date.now();
  // TODO: do not unblock if not blocked by us
  this.ol3d.setBlockCesiumRendering(false);
  this.stoppedRendering = false;
};


/**
 * @param {boolean} debug
 * @api
 */
olcs.AutoRenderLoop.prototype.setDebug = function(debug) {
  this.verboseRendering = debug;
};
</code></pre>
        </article>
    </section>





        <footer>
            Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Wed Sep 06 2017 08:16:39 GMT+0200 (CEST)
        </footer>
    </div>
</div>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
<script src="scripts/main.js"></script>
</body>
</html>
